package com.baifc.netty.rpc.consumer;

import com.baifc.netty.rpc.api.IRpcHelloService;
import com.baifc.netty.rpc.api.IRpcMathService;
import com.baifc.netty.rpc.consumer.proxy.RpcProxy;

/**
 * projectName: nettyrpc
 * packageName: com.baifc.netty.rpc.consumer
 * Created: 2019/6/22.
 * Auther: baifc
 * Description:
 */
public class RpcConsumer {

    public static void main(String[] args) {
        IRpcHelloService rpcHello = RpcProxy.create(IRpcHelloService.class);

        System.out.println(rpcHello.sayHello("Tom老师"));

        IRpcMathService service = RpcProxy.create(IRpcMathService.class);

        System.out.println("8 + 2 = " + service.add(8, 2));
        System.out.println("8 - 2 = " + service.sub(8, 2));
        System.out.println("8 * 2 = " + service.mult(8, 2));
        System.out.println("8 / 2 = " + service.div(8, 2));
    }
}
